package com.jiyinit.web.core.common.util;

import java.util.ArrayList;
import java.util.List;

/**
 * @param
 * @author panjianlei
 * @description
 * @create 2017/6/6 9:00
 * @return
 * 解析Excel表格
 */
public class ExcelPrarmUtil {

    /**
     *
     * @param o
     * @return Integer
     */
    public static Integer getIntegerParam(Object o) {
        Integer result = null;
        try {
            String temp = o != null?(String)o:null;
            result = Integer.parseInt(temp.split("\\.")[0]);
        }catch (Exception e){}
        return result;
    }

    /**
     * 获取当前单元格的数据
     * @param o
     * @return String
     */
    public static String getStringParam(Object o) {
        String result=null;
        try {
            result = o != null?String.valueOf(o):"";
        }catch (Exception e){}
        return result.replace(".00","");
    }

    /**
     *
     * @param o
     * @return Double
     */
    public static Double getDoubleParam(Object o) {
        Double result = null;
        if(o == null){
            return null;
        }
        try {
            String temp = (String)o;
            result = Double.parseDouble(temp);
        }catch (Exception E){}
        return result;
    }

}
